# $Id$
# Maintainer: Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>

pkgbase=python-systemd
pkgname=(python-systemd python2-systemd)
pkgver=234
pkgrel=1
pkgdesc="Python bindings for systemd"
arch=(i686 x86_64)
url="https://github.com/systemd/python-systemd"
license=(LGPL)
makedepends=(systemd python python2 git)
_commit=308ae4440c1f6ea1aff9be4cb683c52bd3a1c13a  # tags/v234^0
source=("$pkgbase::git+${url}#commit=$_commit")
sha256sums=('SKIP')

pkgver() {
  cd $pkgbase
  git describe --tags | sed 's/^v//;s/-/+/g'
}

prepare() {
  cp -a $pkgbase python2
  cp -a $pkgbase python3
}

build() {
  cd python3
  make PYTHON=/usr/bin/python3

  cd ../python2
  make PYTHON=/usr/bin/python2
}

package_python-systemd() {
  depends=(python3 libsystemd)

  cd python3
  python3 setup.py install --root="$pkgdir" --optimize=1 --skip-build
}

package_python2-systemd() {
  depends=(python2 libsystemd)

  cd python2
  python2 setup.py install --root="$pkgdir" --optimize=1 --skip-build
}
